<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Switch Control Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ctdac__functions__switches.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Switch Control Functions<div class="ingroups"><a class="el" href="group__group__ctdac.html">CTDAC        (Continuous Time Digital to Analog Converter)</a> &raquo; <a class="el" href="group__group__ctdac__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This set of functions is for controlling the two CTDAC analog switches, CVD, and CO6. </p>
<p>These are advanced functions. The switches will be managed by the reference source and output mode selections when initializing the hardware. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga35720692cc90978d7433d7446a438c03"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__switches.html#ga35720692cc90978d7433d7446a438c03">Cy_CTDAC_SetAnalogSwitch</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, uint32_t switchMask, <a class="el" href="group__group__ctdac__enums.html#gae03f3ae5e86579ba429987363ee10e9b">cy_en_ctdac_switch_state_t</a> state)</td></tr>
<tr class="memdesc:ga35720692cc90978d7433d7446a438c03"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provide firmware control of the CTDAC switches.  <a href="#ga35720692cc90978d7433d7446a438c03">More...</a><br /></td></tr>
<tr class="separator:ga35720692cc90978d7433d7446a438c03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4adea8df5e58027a0f32e3de9a719bf3"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__switches.html#ga4adea8df5e58027a0f32e3de9a719bf3">Cy_CTDAC_GetAnalogSwitch</a> (const <a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base)</td></tr>
<tr class="memdesc:ga4adea8df5e58027a0f32e3de9a719bf3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the state (open or close) of the CTDAC switches.  <a href="#ga4adea8df5e58027a0f32e3de9a719bf3">More...</a><br /></td></tr>
<tr class="separator:ga4adea8df5e58027a0f32e3de9a719bf3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7a844f509085f39633b2d382238c0d18"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__switches.html#ga7a844f509085f39633b2d382238c0d18">Cy_CTDAC_SetSwitchCO6</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base, <a class="el" href="group__group__ctdac__enums.html#gae03f3ae5e86579ba429987363ee10e9b">cy_en_ctdac_switch_state_t</a> state)</td></tr>
<tr class="memdesc:ga7a844f509085f39633b2d382238c0d18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Open or close switch CO6 that controls whether the output gets routed directly to a pin or through Opamp0 of the CTB.  <a href="#ga7a844f509085f39633b2d382238c0d18">More...</a><br /></td></tr>
<tr class="separator:ga7a844f509085f39633b2d382238c0d18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga649e2ee9ee577dc6397810d0244aa314"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctdac__functions__switches.html#ga649e2ee9ee577dc6397810d0244aa314">Cy_CTDAC_OpenAllSwitches</a> (<a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *base)</td></tr>
<tr class="memdesc:ga649e2ee9ee577dc6397810d0244aa314"><td class="mdescLeft">&#160;</td><td class="mdescRight">Open all switches in the CTDAC (CO6 and CVD).  <a href="#ga649e2ee9ee577dc6397810d0244aa314">More...</a><br /></td></tr>
<tr class="separator:ga649e2ee9ee577dc6397810d0244aa314"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga35720692cc90978d7433d7446a438c03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga35720692cc90978d7433d7446a438c03">&#9670;&nbsp;</a></span>Cy_CTDAC_SetAnalogSwitch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTDAC_SetAnalogSwitch </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>switchMask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctdac__enums.html#gae03f3ae5e86579ba429987363ee10e9b">cy_en_ctdac_switch_state_t</a>&#160;</td>
          <td class="paramname"><em>state</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Provide firmware control of the CTDAC switches. </p>
<p>Each call to this function can open a set of switches or close a set of switches.</p>
<dl class="section note"><dt>Note</dt><dd>The switches are configured by the reference source and output mode selections during initialization.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">switchMask</td><td>The mask of the switches to either open or close. Select one or more values from <a class="el" href="group__group__ctdac__enums.html#ga32e7a16091604113439333e17ae354b2">cy_en_ctdac_switches_t</a> and "OR" them together.</td></tr>
    <tr><td class="paramname">state</td><td>Open or close the switch(es). Select a value from <a class="el" href="group__group__ctdac__enums.html#gae03f3ae5e86579ba429987363ee10e9b">cy_en_ctdac_switch_state_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: In addition to buffering the DAC output through Opamp0 of the connecting</span></div><div class="line"><span class="comment">     * CTB, route the DAC output to a dedicated device pin by closing the CO6 switch. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctdac__functions__switches.html#ga35720692cc90978d7433d7446a438c03">Cy_CTDAC_SetAnalogSwitch</a>(CTDAC0, (uint32_t) <a class="code" href="group__group__ctdac__enums.html#gga32e7a16091604113439333e17ae354b2a5e781ccb78f6a4074999e3287c2a46ca">CY_CTDAC_SWITCH_CO6_MASK</a>, <a class="code" href="group__group__ctdac__enums.html#ggae03f3ae5e86579ba429987363ee10e9bae7fb4d27f795e0ab280aff681324eb81">CY_CTDAC_SWITCH_CLOSE</a>);</div></div><!-- fragment -->
</div>
</div>
<a id="ga4adea8df5e58027a0f32e3de9a719bf3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4adea8df5e58027a0f32e3de9a719bf3">&#9670;&nbsp;</a></span>Cy_CTDAC_GetAnalogSwitch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE uint32_t Cy_CTDAC_GetAnalogSwitch </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the state (open or close) of the CTDAC switches. </p>
<dl class="section note"><dt>Note</dt><dd>The switches will be managed by the reference source and output mode selections when initializing the hardware.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Switch state. Compare this value to the masks found in <a class="el" href="group__group__ctdac__enums.html#ga32e7a16091604113439333e17ae354b2">cy_en_ctdac_switches_t</a>. </dd></dl>

</div>
</div>
<a id="ga7a844f509085f39633b2d382238c0d18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7a844f509085f39633b2d382238c0d18">&#9670;&nbsp;</a></span>Cy_CTDAC_SetSwitchCO6()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CTDAC_SetSwitchCO6 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctdac__enums.html#gae03f3ae5e86579ba429987363ee10e9b">cy_en_ctdac_switch_state_t</a>&#160;</td>
          <td class="paramname"><em>state</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Open or close switch CO6 that controls whether the output gets routed directly to a pin or through Opamp0 of the CTB. </p>
<p>This function calls <a class="el" href="group__group__ctdac__functions__switches.html#ga35720692cc90978d7433d7446a438c03">Cy_CTDAC_SetAnalogSwitch</a> with the switchMask set to <a class="el" href="group__group__ctdac__enums.html#gga32e7a16091604113439333e17ae354b2a5e781ccb78f6a4074999e3287c2a46ca">CY_CTDAC_SWITCH_CO6_MASK</a>.</p>
<dl class="section note"><dt>Note</dt><dd>The switches is configured by the output mode selections during initialization.</dd>
<dd>
This switch will temporarily be opened for deglitching if the deglitch mode is <a class="el" href="group__group__ctdac__enums.html#ggaa5bbaaf21bda846a109573f84f1e2735afc4a6c4c15e30a8c37456639ed6994d6">CY_CTDAC_DEGLITCHMODE_UNBUFFERED</a> or <a class="el" href="group__group__ctdac__enums.html#ggaa5bbaaf21bda846a109573f84f1e2735a60e9b6705b3b6ad9d376e9ae683e53f3">CY_CTDAC_DEGLITCHMODE_BOTH</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">state</td><td>State of the switch, open or close.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: In addition to buffering the DAC output through Opamp0 of the connecting</span></div><div class="line"><span class="comment">     * CTB, route the DAC output to a dedicated device pin by closing the CO6 switch. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctdac__functions__switches.html#ga7a844f509085f39633b2d382238c0d18">Cy_CTDAC_SetSwitchCO6</a>(CTDAC0, <a class="code" href="group__group__ctdac__enums.html#ggae03f3ae5e86579ba429987363ee10e9bae7fb4d27f795e0ab280aff681324eb81">CY_CTDAC_SWITCH_CLOSE</a>);</div></div><!-- fragment -->
</div>
</div>
<a id="ga649e2ee9ee577dc6397810d0244aa314"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga649e2ee9ee577dc6397810d0244aa314">&#9670;&nbsp;</a></span>Cy_CTDAC_OpenAllSwitches()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_CTDAC_OpenAllSwitches </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_d_a_c___type.html">CTDAC_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Open all switches in the CTDAC (CO6 and CVD). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Reset all the switches to destroy all previous connections. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctdac__functions__switches.html#ga649e2ee9ee577dc6397810d0244aa314">Cy_CTDAC_OpenAllSwitches</a>(CTDAC0);</div></div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
